Integrand size = 23, antiderivative size = 55 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {1}{2} (a-b) (a+3 b) x+\frac {(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {b^2 \tan (c+d x)}{d} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3756, 398, 393, 209} \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {(a-b)^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (a+3 b) (a-b)+\frac {b^2 \tan (c+d x)}{d} \]
[In]
[Out]
Rule 209
Rule 393
Rule 398
Rule 3756
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (b^2+\frac {a^2-b^2+2 (a-b) b x^2}{\left (1+x^2\right )^2}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {b^2 \tan (c+d x)}{d}+\frac {\text {Subst}\left (\int \frac {a^2-b^2+2 (a-b) b x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {b^2 \tan (c+d x)}{d}+\frac {((a-b) (a+3 b)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d} \\ & = \frac {1}{2} (a-b) (a+3 b) x+\frac {(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {b^2 \tan (c+d x)}{d} \\ \end{align*}
Time = 1.09 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {2 \left (a^2+2 a b-3 b^2\right ) (c+d x)+(a-b)^2 \sin (2 (c+d x))+4 b^2 \tan (c+d x)}{4 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(110\) vs. \(2(51)=102\).
Time = 1.88 (sec) , antiderivative size = 111, normalized size of antiderivative = 2.02
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+2 a b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(111\) |
default | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+2 a b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(111\) |
risch | \(\frac {x \,a^{2}}{2}+x a b -\frac {3 x \,b^{2}}{2}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a b}{4 d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{8 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a b}{4 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {2 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(146\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.25 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} d x \cos \left (d x + c\right ) + {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.20 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {2 \, b^{2} \tan \left (d x + c\right ) + {\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} {\left (d x + c\right )} + \frac {{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 594 vs. \(2 (51) = 102\).
Time = 0.77 (sec) , antiderivative size = 594, normalized size of antiderivative = 10.80 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {a^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 2 \, a b d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + a^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right ) + 2 \, a b d x \tan \left (d x\right )^{3} \tan \left (c\right ) - 3 \, b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right ) - a^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, a b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + a^{2} d x \tan \left (d x\right ) \tan \left (c\right )^{3} + 2 \, a b d x \tan \left (d x\right ) \tan \left (c\right )^{3} - 3 \, b^{2} d x \tan \left (d x\right ) \tan \left (c\right )^{3} - a^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 2 \, a b \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - 3 \, b^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - a^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 2 \, a b \tan \left (d x\right )^{2} \tan \left (c\right )^{3} - 3 \, b^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} - a^{2} d x \tan \left (d x\right )^{2} - 2 \, a b d x \tan \left (d x\right )^{2} + 3 \, b^{2} d x \tan \left (d x\right )^{2} + a^{2} d x \tan \left (d x\right ) \tan \left (c\right ) + 2 \, a b d x \tan \left (d x\right ) \tan \left (c\right ) - 3 \, b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - a^{2} d x \tan \left (c\right )^{2} - 2 \, a b d x \tan \left (c\right )^{2} + 3 \, b^{2} d x \tan \left (c\right )^{2} - 2 \, b^{2} \tan \left (d x\right )^{3} + 2 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 4 \, a b \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, a^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} - 4 \, a b \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, b^{2} \tan \left (c\right )^{3} - a^{2} d x - 2 \, a b d x + 3 \, b^{2} d x - a^{2} \tan \left (d x\right ) + 2 \, a b \tan \left (d x\right ) - 3 \, b^{2} \tan \left (d x\right ) - a^{2} \tan \left (c\right ) + 2 \, a b \tan \left (c\right ) - 3 \, b^{2} \tan \left (c\right )}{2 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + d \tan \left (d x\right )^{3} \tan \left (c\right ) - d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right ) \tan \left (c\right )^{3} - d \tan \left (d x\right )^{2} + d \tan \left (d x\right ) \tan \left (c\right ) - d \tan \left (c\right )^{2} - d\right )}} \]
[In]
[Out]
Time = 12.29 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.65 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {\sin \left (2\,c+2\,d\,x\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{2\,d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a-b\right )\,\left (a+3\,b\right )}{2\,\left (\frac {a^2}{2}+a\,b-\frac {3\,b^2}{2}\right )}\right )\,\left (a-b\right )\,\left (a+3\,b\right )}{2\,d} \]
[In]
[Out]